<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改整机服务订单')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-electricOrder-edit" th:object="${zsyhElectricOrder}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">联系人：</label>
                        <div class="col-sm-8">
                            <p name="userName" style="border-width: 0px;padding:6px 4px;"  class="form-control" type="text">[[*{userName}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">联系电话：</label>
                        <div class="col-sm-8">
                            <p name="userPhone" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{userPhone}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">详细地址：</label>
                        <div class="col-sm-8">
                            <p name="userAddress" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{userAddress}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">服务类型：</label>
                        <div class="col-sm-8">
                            <select id="serviceTypeId" style="border: 0;appearance:none;background: transparent;" name="serviceTypeId" class="form-control m-b" th:with="type=${@dict.getType('electric_type')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{serviceTypeId}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">预约单状态：</label>
                        <div class="col-sm-8">
                            <select id="orderState" name="orderState" style="border: 0;appearance:none;background: transparent;" class="form-control m-b" th:with="type=${@dict.getType('electric_state')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{orderState}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">报修数量：</label>
                        <div class="col-sm-8">
                            <p name="orderNumber" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{orderNumber}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">故障说明：</label>
                        <div class="col-sm-8">
                            <p name="faultComment" style="border-width: 0px;padding:6px 4px;" class="form-control">[[*{faultComment}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">订单备注：</label>
                        <div class="col-sm-8">
                            <p name="cancelRemark" style="border-width: 0px;padding:6px 4px;" class="form-control">[[*{cancelRemark}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">购买日期：</label>
                        <div class="col-sm-8">
                            <p name="cancelRemark" style="border-width: 0px;padding:6px 4px;" class="form-control">[[${#dates.format(zsyhElectricOrder.buyTime, 'yyyy-MM-dd')}]]</p>
                            <!--<div class="input-group date">
                                <input name="buyTime" th:value="${#dates.format(zsyhElectricOrder.buyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            </div>-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">产品条码：</label>
                        <div class="col-sm-8">
                            <p name="electricCode" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{electricCode}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">支付费用：</label>
                        <div class="col-sm-8">
                            <p name="payMoney" style="border-width: 0px;padding:6px 4px;" class="form-control" type="text">[[*{payMoney}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">客户备注：</label>
                        <div class="col-sm-8">
                            <p name="orderRemark" style="border-width: 0px;padding:6px 4px;" class="form-control">[[*{orderRemark}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">购买票据：</label>
                        <div class="col-sm-8">
                            <input type="hidden" name="buyTicket" th:field="*{buyTicket}">
                            <div class="file-loading">
                                <input class="form-control file-upload" id="buyTicket" name="file" type="file">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">支付费用凭证：</label>
                        <div class="col-sm-8">
                            <input type="hidden" name="payImages" th:field="*{payImages}">
                            <div class="file-loading">
                                <input class="form-control file-upload" id="payImages" name="file" type="file">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">上传图片：</label>
                        <div class="col-xs-10">
                            <input type="hidden" name="orderImage" th:field="*{orderImage}">
                            <div class="file-loading">
                                <input class="form-control file-upload" id="orderImage" name="file" type="file">
                            </div>
                        </div>
                    </div>
                </div>
            </div>





        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/electricOrder";
        $("#form-electricOrder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-electricOrder-edit').serialize());
            }
        }

        $("input[name='buyTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val()
            var imageArr = val.split("|");
            $(this).fileinput({
                'uploadUrl': ctx + 'common/uploadOSS',
                initialPreviewAsData: true,
                initialPreview: imageArr,
                maxFileCount: 1,
                showRemove: false,/*是否显示移除按钮*/
                showUpload: false,/*是否显示上传按钮*/
                showBrowse: false,/*是否显示浏览按钮,选择按钮*/
                showCaption: false, /*是否显示被选文件的简介*/
                autoReplace: true,
                layoutTemplates: {
                    actionDelete:'',
                    actionUpload:''
                } /*去掉缩略图上的删除和上传按钮*/
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });
    </script>
</body>
</html>